package edu.upol.paradise.compiler.types;

import org.apache.log4j.Logger;

public class ParadiseFixnum extends ParadiseNumber {
	static final Logger log = Logger.getLogger(ParadiseFixnum.class);
	
	private int value = 0;
	
	public ParadiseFixnum(int value){
		this.setValue(value);
	}

	public int getValue() {
		return value;
	}

	public ParadiseFixnum setValue(int value) {
		this.value = value;
		return this;
	}
	
	public String toString(){
		return ""+value;
	}

	public boolean valueEquals(ParadiseObject other) {
		if (other instanceof ParadiseFixnum && ((ParadiseFixnum)other).value == value)
			return true;
		return false;
	}
	
	public int atomHashId() {
		return new Integer(value).hashCode();
	}

	@Override
	protected double floatValue() {
		return value;
	}
}
